﻿@using HynuIOTA.Entity

@{
    User user = ViewBag.user;
    ViewBag.Title = "编辑用户";
}
@section scripts
{
    <script>
        function doBegin() {
            $.msgBoxObj.showMsgInfo('正在提交数据....');
        }

        function doFail() {
            $.msgBoxObj.showMsgErr('网络异常!');
        }

        function doComplete(xhrObj) {
            $.processJsonMsg(xhrObj.responseText, function (response) {
                if (response.Statu === 1) {
                    window.top.topHelper.closeComWindow();
                    window.top.topHelper.updateDataGrid();
                }
            });
        }
    </script>
}
<div>
    @using (Ajax.BeginForm("PutUser", new { area = "Admin", controller = "User" }, new AjaxOptions()
    {
        HttpMethod = "Put",
        OnBegin = "doBegin",
        OnFailure = "doFail",
        OnComplete = "doComplete"
    }, new { id = "user-form", name = "blog-form" }))
    {
        <form action="@Url.Action("PutUser", "User", new {area = "Admin"})" method="Put">
            <input type="hidden" name="Id" value="@user.Id" />
            <label>用户名:</label><input type="text" name="UserName" value="@user.UserName" /><br>
            <label>邮箱号:</label><input type="text" name="Email" value="@user.Email" /><br>
            <label>QQ号:</label><input type="text" name="QQNum" value="@user.QQNum" /><br>
            <label>真实姓名:</label><input type="text" name="RealName" value="@user.RealName" /><br>
            <label>性别:</label><input type="text" name="Gender" value="@user.Gender" /><br>
            <label>电话:</label><input type="text" name="Telephone" value="@user.Telephone" /><br>
            <label>地址:</label><input type="text" name="Address" value="@user.Address" /><br>
            <label>邮政编码:</label><input type="text" name="PostCode" value="@user.PostCode" /><br>
            <label>个人简介:</label><input type="text" name="Info" value="@user.Info" /><br>
            <label>生日:</label><input type="text" name="Birthday" value="@user.Birthday" /><br>
            <input type="submit" name="submit" value="提交" />
            <input type="reset" name="reset" value="重置" />
        </form>
    }
</div>
